<%@ include file="/WEB-INF/jsp/include/head.jsp" %><%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.google.code.facebookapi.*"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:fb="http://www.facebook.com/2008/fbml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>geeksaga sns</title>
  </head>
  <body>
    <h1>geeksaga sns</h1>
    <fb:login-button></fb:login-button>
<script type="text/javascript"
	src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
<script type="text/javascript">
	FB.init("130474303653206");
</script>
    
<%
//	String apiKey = "d33366b497d8f7e992c8b49a58afa50a";
//	String secretKey = "9351ad001fa4ff6269ac9354c08356d4";
//	FacebookJsonRestClient frc = null;
//	String sessionKey = (String) session.getAttribute("facebookSession");
	String token = request.getParameter("auth_token");
	out.println(token);
//
//int myid = 0;
//try {
//	if (sessionKey != null && sessionKey.length() > 0) {
//		frc = new FacebookJsonRestClient(apiKey, secretKey, sessionKey);
		
//		myid = (int) frc.users_getLoggedInUser();
//		out.println(myid);
		// Get my information
////		Document d = frc.users_getInfo(users, fields);
////		String myname = d.getElementsByTagName(“name”).item(0).getTextContent();
////		String mypicture = d.getElementsByTagName(“pic”).item(0).getTextContent();
////		this.doTheThing(request, response, frc);
//	} else if (token != null) {
//		frc = new FacebookJsonRestClient(apiKey, secretKey);
//		session.setAttribute("facebookSession", sessionKey);
//		sessionKey = frc.auth_getSession(token);
//		session.setAttribute("facebookSession", sessionKey);
//	} else {
//		response.sendRedirect("http://www.facebook.com/login.php?api_key=" + apiKey + "&v=1.0&canvas=true" );
//	} 
//	
//} catch (Exception e) {
//}


%>        
    
  </body>
</html>